import 'package:pornhub_app/http/http_service.dart';
import 'package:pornhub_app/model/original_flavor_cell_model/original_flavor_cell_model.dart';

abstract class OriginalFlavorRepository {
  Future<List<OriginalFlavorCellModel>> fetchOriginalFlavorList(
      {String? title, int? page = 1});
}

class OriginalFlavorRepositoryImpl extends OriginalFlavorRepository {
  @override
  Future<List<OriginalFlavorCellModel>> fetchOriginalFlavorList(
      {String? title, int? page = 1}) async {
    List<OriginalFlavorCellModel> result = await httpInstance.get(
        url: 'product/list',
        queryMap: {
          'page': page,
          'pageSize': 10,
          'title': title,
        },
        complete: OriginalFlavorCellModel.fromJson);
    return result;
  }
}
